<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"/>
  <title></title>
 <!--  <link rel="shortcut icon" href="./favicon.ico">
  <link rel="Bookmark" href="./favicon.ico"> -->
  <meta title="keywords" content="">
  <meta title="description" content="">
  <link rel="stylesheet" type="text/css" href="css/common.css">
</head>
<body>

  <div class="traceable">
      <div class="topTitle">
        票据打印<span class="eid" style="font-size: 20px;"></span>
      </div>
      <div>
        <div class="left fl">
          <div style="margin-top: 20px;"> </div>
          <div id="traceableCode" class="traceableCode">
              
          </div>
          <div>请扫码打印</div>
          <div id="guid" style="color: #000000; font-size: 14px;"></div>
        </div>
        <div class="right fl">
            <div> </div>
            
        </div>
        <div class="clearfix"></div>
      </div>
  </div>

</body>
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/jquery.qrcode.min.js"></script>
<script src="js/md5.js"></script>
<script src="js/common.js"></script>

<script type="text/javascript">
$(document).ready(function() {
    $(".traceable").width($(window).width());
    $(".traceable").height($(window).height());
    loadEid();
    showTraceableCode();
});

function loadEid() {
  $('.eid').html(getEid());
}
function getEid() {
  var eid = '';
  try {
    eid = client.getEid();
  } catch (error) {
  }
  return eid;
}
function addPrintJob(jobid) {
  try {
    client.setJobid(jobid);
  } catch (error) {
  }
}

function showTraceableCode() {
  var jobid = guid();
  $('#guid').html(jobid);

  addPrintJob(jobid);

  var url = 'https://itt.bluecerana.com/router?eid=' + getEid() + '&jobid=' + jobid + '&urlCode=PRINTLIST_URL';

  var w = 400;
  var h = 400; 
  $("#traceableCode").html('');
  $("#traceableCode").qrcode({
    width: w,
    height: h,
    text: url,
  });
}

function guid() {
  function S4() {
    return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
  }
  return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
}

</script>
</html>